package com.server.model.all.user.dto;

import com.server.model.all.constant.PatternConstant;
import lombok.Builder;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class RegisterUserDto {

    /**
     * 用户名
     * @author LXC
     * @date 2022/5/3 17:09
     */
    @NotBlank(message = "用户名不可为空")
    @Length(min = 2,message = "用户名长度需大于等于2")
    @Length(max = 20,message = "用户名长度需小于等于20")
    private String userName;

    /**
     * 真实姓名
     * @author LXC
     * @date 2022/5/5 12:51
     */
    @NotBlank(message = "真实姓名不可为空")
    @Length(min = 2,message = "真实姓名长度必须大于等于2")
    private String realName;

    /**
     * 手机号
     * @author LXC
     * @date 2022/6/22 23:51
     */
    @NotBlank(message = "手机号不可为空")
    @Pattern(regexp = PatternConstant.REGEX_MOBILE_EXACT,message = "手机号不合法")
    private String mobile;

    /**
     * 邮箱
     * @author LXC
     * @date 2022/6/22 23:51
     */
    @NotBlank(message = "邮箱不可为空")
    @Pattern(regexp = PatternConstant.REGEX_EMAIL_EXACT,message = "邮箱不合法")
    private String email;

    /**
     * 短信验证码
     * @author LXC
     * @date 2022/6/23 21:56
     */
    @NotBlank(message = "验证码不可为空")
    @Length(min = 4,max = 4,message = "验证码长度必须等于4")
    private String smsCode;

    /**
     * 密码
     * @author LXC
     * @date 2022/5/3 17:10
     */
    @NotBlank(message = "密码不可为空")
    @Length(min = 6,message = "密码长度必须大于等于6")
    @Length(max = 20,message = "密码长度必须小于等于20")
    @Pattern(regexp = PatternConstant.CONTAIN_CAPITALIZE_LETTER,message = "密码需要包含大写字母")
    @Pattern(regexp = PatternConstant.CONTAIN_LOW_LETTER,message = "密码需要包含小写字母")
    @Pattern(regexp = PatternConstant.CONTAIN_NUMBER,message = "密码需要包含数字")
    private String passWord;


}
